#srcDir=$(shell pwd)
export GOOS=linux
export GOARCH=amd64

all: clean deps build compress

agent: clean deps build-agent compress
manage: clean deps build-manage compress

clean:
	-rm -rf $(dir $(abspath $(lastword $(MAKEFILE_LIST))))target/

deps:
	go mod tidy

build: build-agent build-manage

build-agent:
	go build -ldflags "-s -w" -o target/deploy-agent cmd/agent/main.go
build-manage:
	go build -ldflags "-s -w" -o target/manage cmd/manage/main.go

compress:
	upx --lzma target/*